package com.yan.design.two.behavior.s11;


/**
 * 11. 责任链模式
 *        C 权限 类
 * @author shengren.yan
 * @create 2022-08-15
 */
public class CdempApprover extends Approver {

    public CdempApprover(String name){
        super(name);
    }

    @Override
    public void process(PurchasrRequest p) {
        if (p.getPrice() > 600 && p.getPrice() <= 700) {
            System.out.println("请求"+p.getId() + this.name + " : " + p.getPrice());
        }else {
            approver.process(p);
        }
    }
}
